<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>DOM</title>
</head>
<body>
<input type="text" id="i1">
<input type="text" id="i2">
<button onclick="f1()">按钮</button>
<hr>
<h3>震惊：<span class="s"></span></h3>
<button onclick="f2()">按钮</button>

<script>
    function f2(){
        let s1 = document.querySelector('.s');
        //s1.innerHTML='昨日A股涨幅竟然高达...';
        //s1.innerHTML='昨日<mark>A股</mark>涨幅竟然高达...';
        s1.innerHTML='<table border="1">\n' +
            '    <tr>\n' +
            '        <td>张三</td>\n' +
            '        <td>30</td>\n' +
            '        <td>男</td>\n' +
            '    </tr>\n' +
            '</table>';

    }
    function f1(){
        let i1 = document.querySelector('#i1');/*根据id选择器获取元素*/
        let i2 = document.getElementById('i2');/*根据元素id值获取元素*/
        console.log(i1.value,i2.value);
        /*输入框中获取的值是字符串类型*/
        console.log(typeof i1.value)
        let v1 = parseFloat(i1.value);
        let v2 = parseFloat(i2.value);


    }
</script>
</body>
</html>